
#import "BYNetwork.h"

static BYNetwork * _sharedNetwork;

@implementation BYNetwork

- (id)init
{
    self=[super init];
    if (self) {
        globalNetEngine=nil;
    }
    return self;
}

+ (BYNetwork *) sharedNetwork
{
    if (_sharedNetwork != nil) {
        return _sharedNetwork;
    }
    _sharedNetwork = [[BYNetwork alloc] init];
    return _sharedNetwork;
}

- (MKNetworkEngine *) sharedNetworkEngine
{
    if (globalNetEngine != nil) {
        return globalNetEngine;
    }
    globalNetEngine = [[MKNetworkEngine alloc] init];
    [globalNetEngine useCache];
    return globalNetEngine;
}


@end